package cn.iocoder.yudao.module.cms.agreement.api;

import cn.iocoder.yudao.framework.common.util.object.BeanUtils;
import cn.iocoder.yudao.module.api.cms.agreement.AgreementApi;
import cn.iocoder.yudao.module.api.cms.agreement.dto.AgreementRespDTO;
import cn.iocoder.yudao.module.cms.agreement.dal.dataobject.AgreementDO;
import cn.iocoder.yudao.module.cms.agreement.service.AgreementService;
import jakarta.annotation.Resource;
import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated;

/**
 * <pre>
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 *  协议规则 API 实现
 * OOoO0OOoO0OOOooo0oOOOO0OOOOO0oooOO0ooOOO0Ooooo0OOOOo0ooooO0OOooo0Ooooo0OOOOO
 * </pre>
 *
 * @author 山野羡民（1032694760@qq.com）
 * @since 2024/12/20
 */
@Service
@Validated
public class AgreementApiImpl implements AgreementApi {
    @Resource
    private AgreementService agreementService;

    @Override
    public AgreementRespDTO getAgreement(String identify) {
        AgreementDO agreementDO = agreementService.getContent(identify);
        return BeanUtils.toBean(agreementDO, AgreementRespDTO.class);
    }

}
